import {get} from "@/js/axios_util";


export function initSettings() {
    get('/sys_settings/get', (response) => {
            let lightServerSettings = response.data.result;
            window.lightServerSettings = lightServerSettings;
            updateSettings(lightServerSettings)
        }
    )
}


export function getSysSettings(key) {
    return window.lightServerSettings[key];
}

export function updateSettings(settings) {
    window.lightServerSettings = settings;
    window.lightServerVideoBase = "http://" + location.hostname + ':' + settings.clientVideoPort + '/video/';

}
